﻿<Window x:Class="Navi.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="self"
        WindowStyle="None"
        WindowState="Maximized"
        Title=""
        mc:Ignorable="d"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:View="clr-namespace:Navi.View" d:DesignHeight="900"
        d:DesignWidth="1440"
        Height="900"
        Width="1440"
        AllowsTransparency="True" Background="White">
    <Window.Resources>
        <View:DepthToColorConverter x:Key="depthToColorConverter"></View:DepthToColorConverter>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="500"></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="660"></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition Width="660"></ColumnDefinition>
        </Grid.ColumnDefinitions>

        <TextBlock Grid.Column="1" x:Name="fpsTxt" VerticalAlignment="Top" FontSize="30" Text="25 fps" HorizontalAlignment="Center" Margin="0,100,0,0"></TextBlock>

        <Grid Grid.Row="0" Grid.Column="0" Margin="20,20,0,0">
            <Rectangle Fill="Black"></Rectangle>
            <Border BorderThickness="4" BorderBrush="Black">
                <Image Source="{Binding ElementName=self, Path=RgbImage}" RenderTransformOrigin="0.5,0.5">
                    <Image.RenderTransform>
                        <ScaleTransform ScaleX="-1"></ScaleTransform>
                    </Image.RenderTransform>
                </Image>
            </Border>
        </Grid>

        <Grid Grid.Row="1" Grid.Column="0" Margin="20,20,0,10">
            <Border Width="500" Height="200" HorizontalAlignment="Left" VerticalAlignment="Top" BorderThickness="2" BorderBrush="Black">
                <StackPanel TextBlock.FontSize="50">
                    <StackPanel Orientation="Horizontal" Margin="10,10,0,0">
                        <Image Stretch="Uniform" Width="100" Source="/Navi;component/Resources/BchThin_0000.png" />
                        <TextBlock Margin="20,0,0,0" FontSize="70">#</TextBlock>
                        <TextBlock Margin="20,10,0,0" Text="{Binding ElementName=self, Path=CurrentTag}"></TextBlock>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="5,20,0,0">
                        <TextBlock>Distance:</TextBlock>
                        <TextBlock Margin="20,0,0,0" Text="{Binding ElementName=self, Path=TagModus}"></TextBlock>
                        <TextBlock Margin="10,0,0,0">mm</TextBlock>
                    </StackPanel>
                </StackPanel>
            </Border>

            <TextBlock Margin="0,0,0,0" FontSize="18.667" HorizontalAlignment="Left" VerticalAlignment="Bottom"><Run Language="de-de" Text="Michael Zöllner &amp; Stephan Huber"/><LineBreak/><Run Language="de-de" Text="HCI Group"/><LineBreak/><Run Language="de-de" Text="University of Konstanz"/><LineBreak/><Run Language="de-de" Text="http://hci.uni-konstanz.de"/></TextBlock>
            
        </Grid>

        <Image Grid.Row="1" Name="image2" Stretch="Uniform" Height="320" Source="/Navi;component/Resources/human.png" Grid.ColumnSpan="2" Margin="540,0,0,0" />
        <Grid Grid.Row="0" Grid.Column="2" Margin="0,20,20,0">
            <Rectangle Fill="Black"></Rectangle>
            <Border BorderThickness="4" BorderBrush="Black">
                <Image Source="{Binding ElementName=self, Path=DepthImage}"></Image>
            </Border>
            <Grid>

                <Grid TextBlock.FontSize="25">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="180"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="180"/>
                    </Grid.ColumnDefinitions>

                    <Rectangle Fill="Gray" Opacity="0.5" Height="30" VerticalAlignment="Bottom" Grid.ColumnSpan="3" Margin="5,0,5,5"></Rectangle>

                    <Grid Grid.Column="0">
                        <Rectangle Visibility="Collapsed" x:Name="left" Width="10" Fill="{Binding ElementName=self, Path=LeftDelay, Converter={StaticResource depthToColorConverter}}" VerticalAlignment="Bottom"></Rectangle>
                        <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,40,5" x:Name="leftText" Foreground="White"></TextBlock>
                    </Grid>
                    <Grid Grid.Column="1">
                        <Rectangle Visibility="Collapsed" x:Name="center" Width="10" Fill="{Binding ElementName=self, Path=CenterDelay, Converter={StaticResource depthToColorConverter}}" VerticalAlignment="Bottom"></Rectangle>
                        <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,90,5" x:Name="centerText" Foreground="White"></TextBlock>
                    </Grid>
                    <Grid Grid.Column="2">
                        <Rectangle Visibility="Collapsed" x:Name="right" Width="10" Fill="{Binding ElementName=self, Path=RightDelay, Converter={StaticResource depthToColorConverter}}" VerticalAlignment="Bottom"></Rectangle>
                        <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,40,5" x:Name="rightText" Foreground="White"></TextBlock>
                    </Grid>

                </Grid>
                <Grid x:Name="markerOverlay">
                    <Path Stroke="White" x:Name="topLeftTopRightLine" StrokeThickness="2"></Path>
                    <Path Stroke="White" x:Name="topRightBottomRightLine" StrokeThickness="2"></Path>
                    <Path Stroke="White" x:Name="bottomRightBottomLeftLine" StrokeThickness="2"></Path>
                    <Path Stroke="White" x:Name="bottomLeftTopLeftLine" StrokeThickness="2"></Path>
                </Grid>

                <Line X1="180" Y1="5" X2="180" Y2="475" Stroke="White" StrokeThickness="3"></Line>
                <Line X1="460" Y1="5" X2="460" Y2="475" Stroke="White" StrokeThickness="3"></Line>
            </Grid>
            <StackPanel Visibility="Hidden" Grid.Column="1" TextBlock.FontSize="20">
                <TextBlock>Filter:</TextBlock>
                <StackPanel Orientation="Horizontal">
                    <TextBlock>Threshold in px</TextBlock>
                    <Slider Minimum="50" Maximum="100000" TickFrequency="50" TickPlacement="BottomRight" Value="{Binding ElementName=self, Path=Threshold}" Margin="10,0,0,0" Width="220"></Slider>
                    <TextBlock>
                        <TextBlock.Text>
                            <Binding ElementName="self" Path="Threshold" StringFormat="{}{0} px"></Binding>
                        </TextBlock.Text>
                    </TextBlock>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock>Window Size</TextBlock>
                    <Slider Minimum="1" Maximum="1000" TickFrequency="1" TickPlacement="BottomRight" Width="220" Value="{Binding ElementName=self, Path=WindowSize}" Margin="10,0,0,0"></Slider>
                    <TextBlock>
                        <TextBlock.Text>
                            <Binding ElementName="self" Path="WindowSize" StringFormat="{}{0} mm"></Binding>
                        </TextBlock.Text>
                    </TextBlock>
                </StackPanel>
                <CheckBox IsChecked="{Binding ElementName=self, Path=ShowDepthImage}">Show Depth Image</CheckBox>
                <StackPanel>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition></RowDefinition>
                            <RowDefinition></RowDefinition>
                            <RowDefinition></RowDefinition>
                            <RowDefinition></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition></ColumnDefinition>
                            <ColumnDefinition></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Row="0" Grid.Column="0">Depth</TextBlock>
                        <TextBlock Grid.Row="0" Grid.Column="1">Delay</TextBlock>
                        <TextBox Background="Red" x:Name="txtDepth0" Grid.Row="1" Grid.Column="0" Text="{Binding ElementName=self, Path=Depth0, Mode=TwoWay}"></TextBox>
                        <TextBox Background="Red" x:Name="txtDelay0" Grid.Row="1" Grid.Column="1" Text="{Binding ElementName=self, Path=Delay0, Mode=TwoWay}"></TextBox>
                        <TextBox Background="Orange" x:Name="txtDepth1" Grid.Row="2" Grid.Column="0" Text="{Binding ElementName=self, Path=Depth1, Mode=TwoWay}"></TextBox>
                        <TextBox Background="Orange" x:Name="txtDelay1" Grid.Row="2" Grid.Column="1" Text="{Binding ElementName=self, Path=Delay1, Mode=TwoWay}"></TextBox>
                        <TextBox Background="Green" x:Name="txtDepth3" Grid.Row="3" Grid.Column="0" Text="{Binding ElementName=self, Path=Depth2, Mode=TwoWay}"></TextBox>
                        <TextBox Background="Green" x:Name="txtDelay3" Grid.Row="3" Grid.Column="1" Text="{Binding ElementName=self, Path=Delay2, Mode=TwoWay}"></TextBox>
                    </Grid>
                </StackPanel>
            </StackPanel>

        </Grid>

        <Grid Grid.Row="1" Grid.Column="2" Margin="0,0,20,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="180"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition Width="180"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Image Grid.ColumnSpan="3" Name="image1" Stretch="Uniform" Source="/Navi;component/Resources/human_bubble.png" />
            <StackPanel Grid.Column="0" Width="180" Height="200" VerticalAlignment="Center">

                <View:SimulatedVibrator Height="100"  Mode="{Binding ElementName=self, Path=LeftDelay}"/>
                <View:SimulatedVibrator Height="100"  Mode="{Binding ElementName=self, Path=LeftDelay}"/>

            </StackPanel>
            <StackPanel Grid.Column="1" Width="180" Height="200" VerticalAlignment="Center" Margin="0,15,0,0">

                <View:SimulatedVibrator Height="100"  Mode="{Binding ElementName=self, Path=CenterDelay}"/>
                <View:SimulatedVibrator Height="100"  Mode="{Binding ElementName=self, Path=CenterDelay}"/>

            </StackPanel>
            <StackPanel Grid.Column="2" Width="180" Height="200" VerticalAlignment="Center">

                <View:SimulatedVibrator Height="100"  Mode="{Binding ElementName=self, Path=RightDelay}"/>
                <View:SimulatedVibrator Height="100"  Mode="{Binding ElementName=self, Path=RightDelay}"/>

            </StackPanel>
        </Grid>
        <Path Grid.Column="1" Data="M648,668.5 L800,550" Fill="Black" Height="120.667" Margin="0,71.333,0,0" Grid.Row="1" Stretch="Fill" Stroke="Black" StrokeThickness="3" VerticalAlignment="Top" HorizontalAlignment="Left"/>
        <Path Grid.Column="1" Data="M648,735.5 L796,788" Fill="Black" Height="51.5" Margin="0,0,0,88.25" Grid.Row="1" Stretch="Fill" Stroke="Black" StrokeThickness="3" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>

    </Grid>
</Window>